<?php

/**
 * A simple class for exceptions.
 */
class PCException extends Exception {
	
	/**
	 * Returns the error in XML format.
	 * 
	 * @return XML representation of the exception.
	 */
	public function getXML() {
		// Make XML:
		$buffer = NULL;
		$buffer .= "<error>\r\n";
		$buffer .= "	<code>" . $this->getCode() . "</code>\r\n";
		$buffer .= "	<message>" . $this->getMessage() . "</message>\r\n";
		$buffer .= "	<file>" . $this->getFile() . "</file>\r\n";
		$buffer .= "	<line>" . $this->getLine() . "</line>\r\n";
		$buffer .= "	<trace>" . $this->getTraceAsString() . "</trace>\r\n";
		$buffer .= "</error>\r\n";

		// Return string:
		return $buffer;
	}
}